package com.zf.zffencheng.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zf.zffencheng.model.dto.AdminLoginDTO;
import com.zf.zffencheng.model.dto.ResetPwdDTO;
import com.zf.zffencheng.model.dto.UpdatePwdDTO;
import com.zf.zffencheng.model.pojo.TAdmin;
import com.zf.zffencheng.model.vo.AdminLoginInfoVo;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName: AdminService <br/>
 * Description:  <br/>
 * date: 2021/5/8 16:24<br/>
 *
 * @author william <br/>
 */
public interface AdminService extends IService<TAdmin> {
    String LOGIN_MOBILE_CODE_BUCKET = "login_mobile_code_bucket";
    String LOGIN_TOKEN_BUCKET = "login_token_bucket";
    Long  LOGIN_EXPIRE = 7200L;
    Map<Integer, Integer> ADMIN_TYPE_TO_LOGIN_TYPE = new HashMap<>(4);
    /**
     * 登录
     * @param adminLoginDTO
     * @return
     */
    AdminLoginInfoVo login(AdminLoginDTO adminLoginDTO);

    /**
     * 查询账号
     * @param mobile
     * @return
     */
    TAdmin byAdminNo(String mobile);

    /**
     * 重置密码
     * @param resetPwdDTO
     */
    void resetPwd(ResetPwdDTO resetPwdDTO) throws Exception;

    /**
     * 重置支付密码
     * @param updatePwdDTO
     */
    void resetPayPwd(UpdatePwdDTO updatePwdDTO);

    /**
     * 密码校验
     * @param inputPwd
     * @param sourcePwd
     * @param salt
     */
    void verifyPayPwd(String inputPwd, String sourcePwd, String salt);
}
